// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_PUR_PO
// * CreateDate    : 2014-06-05 18:30:25
// * Creater       : CodeSmith
// * LastChangeDate: 2014-06-05 18:30:25
// * LastChanger   : 2014-06-05 18:30:25
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;
using ESOL.Common;

namespace ESOL.Common.Entity
{
    [DataContract]
	[Serializable]
	public partial class PurPoEntity : EntityBase
    {
        public PurPoTable TableSchema
        {
            get
            {
                return PurPoTable.Current;
            }
		}
		
		public PurPoEntity()
        {

        }
		
		public PurPoEntity(DataRow dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.CreatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["CREATED_DATE"]));
			this.CreatedBy = Convert.ToString(CommonFunctions.ToObject(dr["CREATED_BY"]));
			this.UpdatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["UPDATED_DATE"]));
			this.UpdatedBy = Convert.ToString(CommonFunctions.ToObject(dr["UPDATED_BY"]));
			this.IsActive = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_ACTIVE"]));
			this.CompanyId = Convert.ToString(CommonFunctions.ToObject(dr["COMPANY_ID"]));
			this.SobId = Convert.ToString(CommonFunctions.ToObject(dr["SOB_ID"]));
			this.PoNo = Convert.ToString(CommonFunctions.ToObject(dr["PO_NO"]));
			this.PurchaseType = Convert.ToString(CommonFunctions.ToObject(dr["PURCHASE_TYPE"]));
			this.SupplierId = Convert.ToString(CommonFunctions.ToObject(dr["SUPPLIER_ID"]));
			this.SupplierName = Convert.ToString(CommonFunctions.ToObject(dr["SUPPLIER_NAME"]));
			this.SupplierCode = Convert.ToString(CommonFunctions.ToObject(dr["SUPPLIER_CODE"]));
			this.SupplierContact = Convert.ToString(CommonFunctions.ToObject(dr["SUPPLIER_CONTACT"]));
			this.SupplierTel = Convert.ToString(CommonFunctions.ToObject(dr["SUPPLIER_TEL"]));
			this.SupplierEmail = Convert.ToString(CommonFunctions.ToObject(dr["SUPPLIER_EMAIL"]));
			this.QuNo = Convert.ToString(CommonFunctions.ToObject(dr["QU_NO"]));
			this.DeliveryAdd = Convert.ToString(CommonFunctions.ToObject(dr["DELIVERY_ADD"]));
			this.Currency = Convert.ToString(CommonFunctions.ToObject(dr["CURRENCY"]));
			this.TransportFee = Convert.ToDecimal(CommonFunctions.ToObject(dr["TRANSPORT_FEE"]));
			this.PaymentType = Convert.ToString(CommonFunctions.ToObject(dr["PAYMENT_TYPE"]));
			this.Prepayment = Convert.ToDecimal(CommonFunctions.ToObject(dr["PREPAYMENT"]));
			this.TotalAmount = Convert.ToDecimal(CommonFunctions.ToObject(dr["TOTAL_AMOUNT"]));
			this.IsTax = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_TAX"]));
			this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
			this.Status = Convert.ToString(CommonFunctions.ToObject(dr["STATUS"]));
        }
		
		public PurPoEntity(DataRowView dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.CreatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["CREATED_DATE"]));
			this.CreatedBy = Convert.ToString(CommonFunctions.ToObject(dr["CREATED_BY"]));
			this.UpdatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["UPDATED_DATE"]));
			this.UpdatedBy = Convert.ToString(CommonFunctions.ToObject(dr["UPDATED_BY"]));
			this.IsActive = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_ACTIVE"]));
			this.CompanyId = Convert.ToString(CommonFunctions.ToObject(dr["COMPANY_ID"]));
			this.SobId = Convert.ToString(CommonFunctions.ToObject(dr["SOB_ID"]));
			this.PoNo = Convert.ToString(CommonFunctions.ToObject(dr["PO_NO"]));
			this.PurchaseType = Convert.ToString(CommonFunctions.ToObject(dr["PURCHASE_TYPE"]));
			this.SupplierId = Convert.ToString(CommonFunctions.ToObject(dr["SUPPLIER_ID"]));
			this.SupplierName = Convert.ToString(CommonFunctions.ToObject(dr["SUPPLIER_NAME"]));
			this.SupplierCode = Convert.ToString(CommonFunctions.ToObject(dr["SUPPLIER_CODE"]));
			this.SupplierContact = Convert.ToString(CommonFunctions.ToObject(dr["SUPPLIER_CONTACT"]));
			this.SupplierTel = Convert.ToString(CommonFunctions.ToObject(dr["SUPPLIER_TEL"]));
			this.SupplierEmail = Convert.ToString(CommonFunctions.ToObject(dr["SUPPLIER_EMAIL"]));
			this.QuNo = Convert.ToString(CommonFunctions.ToObject(dr["QU_NO"]));
			this.DeliveryAdd = Convert.ToString(CommonFunctions.ToObject(dr["DELIVERY_ADD"]));
			this.Currency = Convert.ToString(CommonFunctions.ToObject(dr["CURRENCY"]));
			this.TransportFee = Convert.ToDecimal(CommonFunctions.ToObject(dr["TRANSPORT_FEE"]));
			this.PaymentType = Convert.ToString(CommonFunctions.ToObject(dr["PAYMENT_TYPE"]));
			this.Prepayment = Convert.ToDecimal(CommonFunctions.ToObject(dr["PREPAYMENT"]));
			this.TotalAmount = Convert.ToDecimal(CommonFunctions.ToObject(dr["TOTAL_AMOUNT"]));
			this.IsTax = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_TAX"]));
			this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
			this.Status = Convert.ToString(CommonFunctions.ToObject(dr["STATUS"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return PurPoTable.Current;
            }
        }
		
		#region Perporty List
        [DataMember]
        public string Id
        {
            get { return Convert.ToString(GetData(PurPoTable.C_ID)); }
            set { SetData(PurPoTable.C_ID, value); }
        }
		
        [DataMember]
        public DateTime CreatedDate
        {
            get { return Convert.ToDateTime(GetData(PurPoTable.C_CREATED_DATE)); }
            set { SetData(PurPoTable.C_CREATED_DATE, value); }
        }
		
        [DataMember]
        public string CreatedBy
        {
            get { return Convert.ToString(GetData(PurPoTable.C_CREATED_BY)); }
            set { SetData(PurPoTable.C_CREATED_BY, value); }
        }
		
        [DataMember]
        public DateTime UpdatedDate
        {
            get { return Convert.ToDateTime(GetData(PurPoTable.C_UPDATED_DATE)); }
            set { SetData(PurPoTable.C_UPDATED_DATE, value); }
        }
		
        [DataMember]
        public string UpdatedBy
        {
            get { return Convert.ToString(GetData(PurPoTable.C_UPDATED_BY)); }
            set { SetData(PurPoTable.C_UPDATED_BY, value); }
        }
		
        [DataMember]
        public int IsActive
        {
            get { return Convert.ToInt32(GetData(PurPoTable.C_IS_ACTIVE)); }
            set { SetData(PurPoTable.C_IS_ACTIVE, value); }
        }
		
        [DataMember]
        public string CompanyId
        {
            get { return Convert.ToString(GetData(PurPoTable.C_COMPANY_ID)); }
            set { SetData(PurPoTable.C_COMPANY_ID, value); }
        }
		
        [DataMember]
        public string SobId
        {
            get { return Convert.ToString(GetData(PurPoTable.C_SOB_ID)); }
            set { SetData(PurPoTable.C_SOB_ID, value); }
        }
		
        [DataMember]
        public string PoNo
        {
            get { return Convert.ToString(GetData(PurPoTable.C_PO_NO)); }
            set { SetData(PurPoTable.C_PO_NO, value); }
        }
		
        [DataMember]
        public string PurchaseType
        {
            get { return Convert.ToString(GetData(PurPoTable.C_PURCHASE_TYPE)); }
            set { SetData(PurPoTable.C_PURCHASE_TYPE, value); }
        }
		
        [DataMember]
        public string SupplierId
        {
            get { return Convert.ToString(GetData(PurPoTable.C_SUPPLIER_ID)); }
            set { SetData(PurPoTable.C_SUPPLIER_ID, value); }
        }
		
        [DataMember]
        public string SupplierName
        {
            get { return Convert.ToString(GetData(PurPoTable.C_SUPPLIER_NAME)); }
            set { SetData(PurPoTable.C_SUPPLIER_NAME, value); }
        }
		
        [DataMember]
        public string SupplierCode
        {
            get { return Convert.ToString(GetData(PurPoTable.C_SUPPLIER_CODE)); }
            set { SetData(PurPoTable.C_SUPPLIER_CODE, value); }
        }
		
        [DataMember]
        public string SupplierContact
        {
            get { return Convert.ToString(GetData(PurPoTable.C_SUPPLIER_CONTACT)); }
            set { SetData(PurPoTable.C_SUPPLIER_CONTACT, value); }
        }
		
        [DataMember]
        public string SupplierTel
        {
            get { return Convert.ToString(GetData(PurPoTable.C_SUPPLIER_TEL)); }
            set { SetData(PurPoTable.C_SUPPLIER_TEL, value); }
        }
		
        [DataMember]
        public string SupplierEmail
        {
            get { return Convert.ToString(GetData(PurPoTable.C_SUPPLIER_EMAIL)); }
            set { SetData(PurPoTable.C_SUPPLIER_EMAIL, value); }
        }
		
        [DataMember]
        public string QuNo
        {
            get { return Convert.ToString(GetData(PurPoTable.C_QU_NO)); }
            set { SetData(PurPoTable.C_QU_NO, value); }
        }
		
        [DataMember]
        public string DeliveryAdd
        {
            get { return Convert.ToString(GetData(PurPoTable.C_DELIVERY_ADD)); }
            set { SetData(PurPoTable.C_DELIVERY_ADD, value); }
        }
		
        [DataMember]
        public string Currency
        {
            get { return Convert.ToString(GetData(PurPoTable.C_CURRENCY)); }
            set { SetData(PurPoTable.C_CURRENCY, value); }
        }
		
        [DataMember]
        public decimal TransportFee
        {
            get { return Convert.ToDecimal(GetData(PurPoTable.C_TRANSPORT_FEE)); }
            set { SetData(PurPoTable.C_TRANSPORT_FEE, value); }
        }
		
        [DataMember]
        public string PaymentType
        {
            get { return Convert.ToString(GetData(PurPoTable.C_PAYMENT_TYPE)); }
            set { SetData(PurPoTable.C_PAYMENT_TYPE, value); }
        }
		
        [DataMember]
        public decimal Prepayment
        {
            get { return Convert.ToDecimal(GetData(PurPoTable.C_PREPAYMENT)); }
            set { SetData(PurPoTable.C_PREPAYMENT, value); }
        }
		
        [DataMember]
        public decimal TotalAmount
        {
            get { return Convert.ToDecimal(GetData(PurPoTable.C_TOTAL_AMOUNT)); }
            set { SetData(PurPoTable.C_TOTAL_AMOUNT, value); }
        }
		
        [DataMember]
        public int IsTax
        {
            get { return Convert.ToInt32(GetData(PurPoTable.C_IS_TAX)); }
            set { SetData(PurPoTable.C_IS_TAX, value); }
        }
		
        [DataMember]
        public string Remark
        {
            get { return Convert.ToString(GetData(PurPoTable.C_REMARK)); }
            set { SetData(PurPoTable.C_REMARK, value); }
        }
		
        [DataMember]
        public string Status
        {
            get { return Convert.ToString(GetData(PurPoTable.C_STATUS)); }
            set { SetData(PurPoTable.C_STATUS, value); }
        }
		
		#endregion
	}
	
	
}	

